package com.action.message;

import com.db.message.*;
import com.opensymphony.xwork2.ActionContext;

import java.util.*;

public class ListAction {

	private List<MessageVO> list = new ArrayList<MessageVO>();

	public List<MessageVO> getList() {
		return list;
	}

	public String send() throws Exception {

		Map session = ActionContext.getContext().getSession();

		String send_id = (String) session.get("login");

		list = MessageDAO.sendAllData(send_id);

		return "success";
	}

	public String recv() throws Exception {

		Map session = ActionContext.getContext().getSession();

		String recv_id = (String) session.get("login");

		list = MessageDAO.recvAllData(recv_id);

		return "success";
	}

}
